package com.example.demo.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.PathMatchConfigurer;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * Description:
 * User: 故我
 * Date: 2023-11-05
 * Time: 14:38
 */
@Configuration
public class AppConfig implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
//        registry.addInterceptor(new LoginInterceptor())
//                .addPathPatterns("/**")  //拦截所有页面
//                .excludePathPatterns("/user/login")  //不拦截页面
//                .excludePathPatterns("/**/*.html");
    }

    @Override
    public void configurePathMatch(PathMatchConfigurer configurer) {
//        configurer.addPathPrefix("/classic", c -> true);//lamda表达式 所有都加前缀
    }
}
